package com.rd.student.dashuju.wangbo.exercise0728;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;

public class Testt {

    @Override
    public boolean equals(Object obj) {
        return super.equals(obj);
    }

    public static void main(String[] args) throws Exception{
        Person person = new Person("taoge",80,new Health("未知"));
        ObjectOutputStream oos =
                new ObjectOutputStream(
                        new FileOutputStream("object.txt"));
        oos.writeObject(person);

        ObjectInputStream ois = new ObjectInputStream(
                new FileInputStream("object.txt")
        );
        Person tao = (Person) ois.readObject();
        System.out.println(tao);



        System.out.println(person == tao);
        System.out.println(person.equals(tao));
    }
}
